package com.Maykk.bytesStream;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * @ClassName: com.Maykk.bytesStream.Demo03
 * @Description: TODO 输出流输入流练习
 * @Author: MaykkStar@163.com
 */
public class Demo03 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("./Maykk.txt");
        FileOutputStream fos = new FileOutputStream("./MaykkNew.txt");
        File file = new File("./MaykkNew.txt");
        if (!file.exists()) System.out.println("创建文件" + file.createNewFile());
        else System.out.println("文件已存在");
        int by;
        while ((by = fis.read()) != -1) {
            fos.write(by);
        }
        fis.close();
        fos.close();
    }
}
